home *** CD-ROM | disk | FTP | other *** search
- this.stop();
- FNscore = function(s, num)
- {
- if(num < 0)
- {
- this.menu_mc.mark.gotoAndStop(2);
- }
- else
- {
- this.menu_mc.mark.gotoAndStop(1);
- }
- var _loc2_ = 1;
- while(_loc2_ <= 5)
- {
- this.menu_mc[s + _loc2_].gotoAndStop(Math.floor(Math.abs(num) / Math.pow(10,_loc2_ - 1)) % 10 + 1);
- _loc2_ = _loc2_ + 1;
- }
- };
- mc_xpos = this.mc._x;
- mc_ypos = this.mc._y;
- this.mc.onPress = function()
- {
- if(this._parent.player_mc._currentframe == 1)
- {
- this.gotoAndStop(2);
- this.startDrag(false);
- }
- };
- this.mc.onRelease = function()
- {
- this.gotoAndStop(3);
- this.stopDrag();
- };
- this.mc.onEnterFrame = function()
- {
- if(this.hitTest(this._parent.clear_mc) && this._currentframe == 3)
- {
- var _loc2_ = 1;
- while(_loc2_ <= 6)
- {
- this._parent.clear_mc.mc["m" + _loc2_].gotoAndStop(this._parent.dish[_loc2_]);
- _loc2_ = _loc2_ + 1;
- }
- this._parent.clear_mc.gotoAndPlay(2);
- this._x = this._parent.mc_xpos;
- this._y = this._parent.mc_ypos;
- this.gotoAndStop(1);
- }
- else if(this.hitTest(this._parent.rec) && this._currentframe == 3)
- {
- this._x = this._parent.mc_xpos;
- this._y = this._parent.mc_ypos;
- this.gotoAndStop(2);
- }
- };
- number = new Array();
- FNmix = function()
- {
- var _loc1_ = 0;
- while(_loc1_ <= 11)
- {
- number[_loc1_] = _loc1_ + 1;
- _loc1_ = _loc1_ + 1;
- }
- _loc1_ = 0;
- while(_loc1_ < 30)
- {
- var _loc3_ = random(12);
- var _loc2_ = random(12);
- var _loc4_ = number[_loc3_];
- number[_loc3_] = number[_loc2_];
- number[_loc2_] = _loc4_;
- _loc1_ = _loc1_ + 1;
- }
- };
- FNpickup = function()
- {
- this.player_mc.player.mc.m.gotoAndStop(name + 1);
- };
- FNputdown = function()
- {
- total_pickup++;
- dish[total_pickup] = name + 1;
- FNscore("s",score);
- this.mc["m" + total_pickup].gotoAndStop(name + 1);
- };
- FNchogi = function()
- {
- level = 1;
- FNscore("l",level);
- score = 0;
- FNscore("s",score);
- game_ok = false;
- this.text_mc.gotoAndStop("start");
- xspeed = 2;
- dish = new Array();
- mc_depths = this.mc.getDepth();
- menu_depths = this.menu_mc.getDepth();
- link_depths = this.link_mc.getDepth();
- this.mc.swapDepths(20);
- this.menu_mc.swapDepths(21);
- this.link_mc.swapDepths(22);
- total_duplicate = total_mission = 5 + (level - 1);
- total_success = 0;
- move_num = 1;
- depths = 1;
- face_num = 1;
- sell = [250,50,50,100,150,100,150,125,125,125,200,250];
- };
- FNchogi();
- FNduplicate = function()
- {
- FNmix();
- this.order_mc.duplicateMovieClip("order_mc" + depths,depths);
- this["order_mc" + depths].number = new Array();
- this["order_mc" + depths].total_number = 0;
- this["order_mc" + depths].sell = 0;
- this["order_mc" + depths].random_number = Math.ceil(level / 2) + random(3);
- trace("number = " + number);
- var _loc3_ = 1;
- while(_loc3_ <= 6)
- {
- if(level > 6)
- {
- if(_loc3_ <= 4 + random(3))
- {
- this["order_mc" + depths].number[_loc3_] = number[_loc3_];
- this["order_mc" + depths].total_number = this["order_mc" + depths].total_number + 1;
- this["order_mc" + depths].sell += sell[number[_loc3_] - 1];
- }
- else
- {
- this["order_mc" + depths].number[_loc3_] = "blank";
- }
- }
- else if(_loc3_ <= this["order_mc" + depths].random_number)
- {
- this["order_mc" + depths].number[_loc3_] = number[_loc3_] + 1;
- this["order_mc" + depths].total_number = this["order_mc" + depths].total_number + 1;
- this["order_mc" + depths].sell += sell[number[_loc3_] - 1];
- }
- else
- {
- this["order_mc" + depths].number[_loc3_] = "blank";
- }
- this["order_mc" + depths].move = true;
- this["order_mc" + depths].move1 = true;
- this["order_mc" + depths].total_ok = 0;
- this["order_mc" + depths].duplicate_ok = true;
- this["order_mc" + depths].mc.comp._visible = false;
- _loc3_ = _loc3_ + 1;
- }
- this["order_mc" + depths].mc.order.gotoAndStop(this["order_mc" + depths].total_number);
- this["order_mc" + depths].mc.comp.gotoAndStop(this["order_mc" + depths].total_number);
- this["order_mc" + depths].onEnterFrame = function()
- {
- if(this.move && this._parent.game_ok)
- {
- if(this._x <= -100)
- {
- this.move = false;
- }
- if(this._x <= this._parent.order_mc._x - 150 && this.duplicate_ok)
- {
- if(this._parent.total_duplicate > 1)
- {
- this.duplicate_ok = false;
- this._parent.total_duplicate--;
- this._parent.FNduplicate();
- }
- else if(this.move1)
- {
- this.move1 = false;
- this._parent["order_mc" + this._parent.move_num]._x = 560;
- this._parent["order_mc" + this._parent.move_num].move = true;
- this._parent["order_mc" + this._parent.move_num].move1 = true;
- this._parent["order_mc" + this._parent.move_num].duplicate_ok = true;
- if(this._parent.move_num < this._parent.total_mission)
- {
- this._parent.move_num = this._parent.move_num + 1;
- }
- else
- {
- this._parent.move_num = 1;
- }
- }
- }
- this._x -= this._parent.xspeed;
- if(this._parent.mc._currentframe == 3)
- {
- if(this.hitTest(this._parent.mc))
- {
- if(this.mc._currentframe == 1)
- {
- var _loc3_ = 1;
- while(_loc3_ <= 6)
- {
- if(_root.dish[_loc3_] != undefined)
- {
- if(_root.dish[_loc3_] == this.number[1] || _root.dish[_loc3_] == this.number[2] || _root.dish[_loc3_] == this.number[3] || _root.dish[_loc3_] == this.number[4] || _root.dish[_loc3_] == this.number[5] || _root.dish[_loc3_] == this.number[6])
- {
- this.total_ok = this.total_ok + 1;
- }
- }
- _loc3_ = _loc3_ + 1;
- }
- trace("length = " + (Number(_root.dish.length) - 1) + " , number = " + this.total_number);
- if(this.total_ok == this.total_number && Number(_root.dish.length) - 1 == this.total_number)
- {
- if(this._parent.menu_mc.time_bar.bar._x < -10 * level)
- {
- this._parent.menu_mc.time_bar.bar._x += 10 * level;
- }
- else
- {
- this._parent.menu_mc.time_bar.bar._x = 0;
- }
- this._parent.score += this.sell;
- this._parent.FNscore("s",this._parent.score);
- this.mc.gotoAndPlay(2);
- this._parent.mc.gotoAndStop(1);
- this._parent.total_success = this._parent.total_success + 1;
- }
- else
- {
- this._parent.mc.gotoAndStop(2);
- }
- this.total_ok = 0;
- this._parent.mc._x = this._parent.mc_xpos;
- this._parent.mc._y = this._parent.mc_ypos;
- }
- }
- }
- }
- };
- depths++;
- };
- var i = 0;
- while(i <= 12)
- {
- this["m" + i].onRollOver = function()
- {
- this.nextFrame();
- };
- this["m" + i].onRollOut = function()
- {
- this.prevFrame();
- };
- this["m" + i].onRelease = function()
- {
- if(this._parent.player_mc._currentframe == 1)
- {
- this.name = Number(this._name.substr(1,2));
- if(this.name == 0 && this._parent.mc._currentframe == 1)
- {
- this._parent.total_pickup = 0;
- this._parent.dish = new Array();
- this._parent.dish[0] = "blank";
- this._parent.mc.gotoAndStop(2);
- }
- if(this._parent.mc._currentframe == 2)
- {
- this._parent.name = this.name;
- if(this.name >= 1 && this.name <= 7)
- {
- this._parent.player_mc.gotoAndStop("left");
- }
- if(this.name >= 8 && this.name <= 12)
- {
- this._parent.player_mc.gotoAndStop("right");
- }
- }
- }
- };
- i++;
- }
- FNstart = function()
- {
- game_ok = true;
- FNduplicate();
- this.order_mc1._x = this.order_mc._x - 50;
- };
- FNlevelup = function()
- {
- FNclear();
- this.menu_mc.time_bar.bar._x = 0;
- level++;
- FNscore("l",level);
- total_duplicate = total_mission = 5 + (level - 1);
- total_success = 0;
- move_num = 1;
- depths = 1;
- };
- FNgameover = function()
- {
- FNclear();
- this.mc.swapDepths(mc_depths);
- this.menu_mc.swapDepths(menu_depths);
- this.link_mc.swapDepths(link_depths);
- this.gotoAndStop("gameover");
- };
- FNclear = function()
- {
- var _loc2_ = 1;
- while(_loc2_ <= total_mission)
- {
- this["order_mc" + _loc2_].gotoAndStop("clear");
- _loc2_ = _loc2_ + 1;
- }
- };
- time_i = 0.1;
- this.onEnterFrame = function()
- {
- if(game_ok)
- {
- if(this.menu_mc.time_bar.bar._x < -176)
- {
- game_ok = false;
- this.mc.swapDepths(mc_depths);
- this.player_mc.gotoAndStop("bad");
- this.text_mc.gotoAndStop("gameover");
- }
- else
- {
- this.menu_mc.time_bar.bar._x -= time_i;
- trace(this.menu_mc.time_bar.bar._x);
- if(this.menu_mc.time_bar.bar._x < -120)
- {
- face_num = 2;
- }
- else
- {
- face_num = 1;
- }
- }
- if(total_success == total_mission && game_ok)
- {
- game_ok = false;
- this.player_mc.gotoAndStop("good");
- this.text_mc.gotoAndStop("levelup");
- }
- }
- if(Key.isDown(32))
- {
- this.menu_mc.time_bar.bar._x = -174;
- }
- };
-